package org.yudidi.service.uesconfig;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yudidi.properties.FooProperties;
import org.yudidi.service.FooService;

import javax.annotation.PostConstruct;

@Service
public class FooServiceImpl implements FooService {

    private static final Logger logger = LoggerFactory.getLogger(FooService.class);

    private FooProperties fooProperties;

    @Autowired
    public FooServiceImpl(FooProperties fooProperties) {
        this.fooProperties = fooProperties;
    }

    /**
     * # 构造函数之后执行
     * 这个注解在这里没实际用处，就是为了方便在该类构造完成后打印日志，看看配置信息是否加载到配置类中了
     */
    @PostConstruct
    public void verifyConfigurationProperties() {
        logger.error(">>>>>>> 使用 FooProperties: {}", fooProperties);
    }

}
